package com.pmh.hrs.sys.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.pmh.hrs.sys.dao.SysCodeTermDAO;
import com.pmh.hrs.sys.service.SysCodeTermService;
import com.pmh.hrs.sys.vo.SysCodeTermVO;

@Service("sysCodeTermService")
public class SysCodeTermServiceImpl implements SysCodeTermService{

	@Resource(name="sysCodeTermDAO")
	private SysCodeTermDAO sysCodeTermDAO;
	
	
	private SysCodeTermVO convertSysCodeTermVO(Map<String,Object> paramMap) throws Exception{
		SysCodeTermVO sysCodeTermVO = new SysCodeTermVO();
		BeanUtils.copyProperties(paramMap, sysCodeTermVO);
		return sysCodeTermVO;
	}
	
	@Override
	public int insert(Map<String,Object> paramMap) throws Exception {
		SysCodeTermVO sysCodeTermVO =  this.convertSysCodeTermVO(paramMap);
		return sysCodeTermDAO.insert(sysCodeTermVO);
	}

	@Override
	public int update(Map<String,Object> paramMap) throws Exception {
		SysCodeTermVO sysCodeTermVO =  this.convertSysCodeTermVO(paramMap);
		return sysCodeTermDAO.update(sysCodeTermVO);
	}

	@Override
	public int delete(Map<String,Object> paramMap) throws Exception {
		return sysCodeTermDAO.delete(paramMap);
	}

	@Override
	public List<Map<String, Object>> selectList(Map<String,Object> paramMap) throws Exception {
		return sysCodeTermDAO.selectList(paramMap);
	}

}
